#pragma once
#ifndef __LIT__FILE__PATH__HH__
#define __LIT__FILE__PATH__HH__

#include <LitPrerequisites.h>
#include <boost\filesystem.hpp>

namespace Lit
{
	struct LIT_API FilePath;
	LIT_API std::ostream& operator<<( std::ostream& strm, const FilePath& p );

	struct LIT_API FilePath
	{
		std::string p;

		friend LIT_API std::ostream& operator<<( std::ostream& strm, const FilePath& p );
	public:
		FilePath( );
		FilePath( const std::string &path );
		FilePath( const char* path );
		FilePath( const FilePath& path );
		~FilePath();
		
		std::string str() const{ return p; }
		bool exists() const;
		FilePath parent() const;
		void sanitise();
		
		std::string extension() const;
		std::string fileName( bool with_ext = true ) const;
		std::string dirName() const;
		
		bool startsWith( const FilePath & path ) const;
		bool endsWith( const FilePath & path ) const;
		bool contains( const FilePath & path ) const;
		std::string removeIfFound( const FilePath & rem_path ) const;

		bool isDir() const;
		void make();

		FilePath& FilePath::operator = ( const FilePath& rk );
		FilePath& FilePath::operator = ( const std::string& rk );
		
		FilePath operator + ( const FilePath& rk ) const;
		FilePath& operator += ( const FilePath& rk );
		FilePath operator + ( const std::string& rk ) const;
		FilePath& operator += ( const std::string& rk );
		FilePath operator + ( const char * str ) const;
		FilePath& operator += ( const char * str );

		operator std::string(){ return p; }
	};
	typedef std::vector<FilePath> FilePathVector;

};

#endif